package core.mouse;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Vector;

public class OBCMouseListener implements MouseListener{
	
	public static Vector<Clickable> clickables = new Vector<Clickable>();
	
	public static void add(Clickable obj){
		clickables.add(obj);
	}

	@Override
	public void mouseClicked(MouseEvent ev) {
		int x = ev.getX();
		int y = ev.getY();
		for(Clickable c : clickables){
			if(c.getBounds().contains(x, y)){
				c.click(x, y);
			}
			
		}
		
	}

	@Override
	public void mouseEntered(MouseEvent ev) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent ev) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent ev) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent ev) {
		// TODO Auto-generated method stub
		
	}

}
